import { computed } from "vue";
import { useStorage } from "@/library/storage";
import { LanguageEnum, LanguageType } from '@/enums/LanguageEnum';

// useStore 只能在setup中使用，所有直接从存储空间拿
const { getStorage } = useStorage("localStorage");
const app = getStorage("app");

const language = computed<LanguageType>(() => app?.language || LanguageEnum.ZH_CN);

/**
 * @description 返回当前使用语言
 */
const useLanguage = () => {
    return language.value
}

export default useLanguage